{% extends 'base.html' %}
{% load staticfiles %}

{# 页面标题 #}
{% block title %}{{ page_title }}{% endblock %}

{# 页面选中状态填补-首页 #}
{% block nav_home_active %}active{% endblock %}

{# 页面内容 #}
{% block content %}
    <div class="containter">
        <div class="row">
            <div class="col-xs-4 col-xs-offset-4">
                <div class="panel panel-default">
                  <div class="panel-heading">
                      <h3 class="panel-title">{{ form_title }}</h3>
                  </div>
                  <div class="panel-body">
                    <form action="#" method="POST">
                        {% csrf_token %}
                        {% for field in form %}
                            {% if not field.is_hidden %}
                                <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                            {% endif %}
                            {{ field }}
                            <p>{{ field.errors.as_text }}</p>
                        {% endfor %}
                        <span id="tip" class="text-danger">{{ form.non_field_errors }}</span>
                        <div class="clearfix"></div>
                        <div class="pull-left">
                            {% block other_buttons %}{% endblock %}
                        </div>
                        <div class="pull-right">
                            <input type="submit" value="{{ submit_text }}" class="btn btn-primary">
                            <button class="btn btn-default" onclick="window.location.href='' +
                            '{{ return_back_url }}'">返回</button>
                        </div>
                    </form>
                  </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

